Define Parameters for a Newly Created Test
Source code
'********************************************************************************************************'Description:''This example starts UFT One and opens a new test'Then it creates 6 parameters'Removes a specific parameter'Remove all the parameters.'********************************************************************************************************' Dim qtApp, ActionContent, ActionName, ActionDescr, NewAction, SecondAction, scriptSet qtApp = CreateObject("QuickTest.Application") ' Create the application object
qtApp.Launch
qtApp.Visible = True
qtApp.New
qtApp.Test.SaveAs "C:\temp\GUITest"Set qtAction1 = qtApp.Test.Actions("Action1")
Set pDefColl = qtApp.Test.ParameterDefinitions

'Create input and output test parameters
pDefColl.Add "INPUT_PARAM_1", "description", 0, 0
pDefColl.Add "INPUT_PARAM_2", "description", 1, 0
pDefColl.Add "INPUT_PARAM_3", "description", 2, 0
pDefColl.Add "OUTPUT_PARAM_1", "description", 3, 1
pDefColl.Add "OUTPUT_PARAM_2", "description", 4, 1
pDefColl.Add "OUTPUT_PARAM_3", "description", 5, 1
count = pDefColl.Count
MsgBox count
' Display the names and values of each of the parameters in the collection.
Indx = 1
While Indx <= count
	Set pDef = pDefColl.Item(Indx)
	MsgBox "Param name: " & pDef.Name & "; Type: " & pDef.Type & "; InOut: " & pDef.InOut & "; Description: " _
				& pDef.Description & "Default value: " & pDef.DefaultValue
	Indx = Indx + 1
Wend'Remove a specific parameter.
pDefColl.Remove("INPUT_PARAM_3")
count = pDefColl.Count
MsgBox count

'Remove all the parameters.
qtApp.Test.ParameterDefinitions.RemoveAll
count = pDefColl.Count
MsgBox count

qtApp.Test.Save